using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class Product_NameMap : EntityTypeConfiguration<Product_Name>
    {
        public Product_NameMap()
        {
            // Primary Key
            this.HasKey(t => t.PN_ID);

            // Properties
            this.Property(t => t.PN_Name)
                .HasMaxLength(50);

            this.Property(t => t.PN_Remark)
                .HasMaxLength(50);

            this.Property(t => t.PN_CoatingDegradation)
                .IsFixedLength()
                .HasMaxLength(5);

            this.Property(t => t.PN_FullyBiodegradable)
                .IsFixedLength()
                .HasMaxLength(5);

            this.Property(t => t.PN_Carrier)
                .IsFixedLength()
                .HasMaxLength(5);

            this.Property(t => t.PN_Rapamycin)
                .IsFixedLength()
                .HasMaxLength(5);

            this.Property(t => t.PN_Taxol)
                .IsFixedLength()
                .HasMaxLength(5);

            this.Property(t => t.PN_ArsenicTrioxide)
                .IsFixedLength()
                .HasMaxLength(5);

            this.Property(t => t.PN_BareMetalStents)
                .IsFixedLength()
                .HasMaxLength(5);

            this.Property(t => t.PN_DrugElutingStents)
                .IsFixedLength()
                .HasMaxLength(5);

            // Table & Column Mappings
            this.ToTable("Product_Name");
            this.Property(t => t.PN_ID).HasColumnName("PN_ID");
            this.Property(t => t.MF_ID).HasColumnName("MF_ID");
            this.Property(t => t.PN_Name).HasColumnName("PN_Name");
            this.Property(t => t.PN_Remark).HasColumnName("PN_Remark");
            this.Property(t => t.PN_CoatingDegradation).HasColumnName("PN_CoatingDegradation");
            this.Property(t => t.PN_FullyBiodegradable).HasColumnName("PN_FullyBiodegradable");
            this.Property(t => t.PN_Carrier).HasColumnName("PN_Carrier");
            this.Property(t => t.PN_Rapamycin).HasColumnName("PN_Rapamycin");
            this.Property(t => t.PN_Taxol).HasColumnName("PN_Taxol");
            this.Property(t => t.PN_ArsenicTrioxide).HasColumnName("PN_ArsenicTrioxide");
            this.Property(t => t.PN_BareMetalStents).HasColumnName("PN_BareMetalStents");
            this.Property(t => t.PN_DrugElutingStents).HasColumnName("PN_DrugElutingStents");
        }
    }
}
